<%
if (_.isEmpty(role_links.where({
	slug: "add_board"
}))) {
	var delete_github_obj = apps;
	if (delete_github_obj.hasOwnProperty('r_import_github')) {
		delete delete_github_obj['r_import_github'];
	}
}
%>
<section class="action-block action-content">
<div class="row navbar navbar-default list-group-item-text">
<ul class="nav nav-pills navbar-left"> 
  <li class="footer-logo active"> 
  	<a href="#/boards" title="<%- SITE_NAME %>" class="js-start"><img src="img/logo-icon.png" alt="[Images: <%- SITE_NAME %>]" title="<%- SITE_NAME %>" id="js-footer-brand-img" /></a>
	<!-- Todo: quick fix. load image before offline. call after when goes offline
	<img src="img/logo-icon-offline.png" alt="[Images: <%- SITE_NAME %>]" style="display:none;" />--->
  </li>
  <% if(!_.isUndefined(authuser.user)){%>
	<li class="hidden-xs music-btn pa"> 
		<% if(board_id !== undefined && board_id !== null && board_id !== "" && !_.isEmpty(this.music_content) && this.music_content !== ''){ %>
			<% if(parseInt(authuser.user.is_productivity_beats) === 1) { %>
				<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action" data-type='on'>
				<span class="show"><i class="icon-volume-up lead tada-animation show"></i></span>
				</a>
			<% } else { %>
				<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action" data-type='off'>
				<span class="show"><i class="icon-volume-off lead text-muted show"></i></span>
				</a>
			<% } %>
		<% } %>
	</li> 
	<% } else { %>
	<li class="hidden-xs music-btn pa">
		<% if(board_id !== undefined && board_id !== null && board_id !== "" && !_.isEmpty(this.music_content) && this.music_content !== ''){ %>
			<% if($.cookie('music_play') === "1") { %>
				<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action" data-type='on'>
				<span class="show"><i class="icon-volume-up lead show"></i></span>
				</a>
			<% } else { %>
				<a href="#" data-toggle="tooltip" data-container="body" data-placement="top" data-original-title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" title="<%- i18next.t('Productivity Beats - %s', { postProcess: 'sprintf', sprintf: [this.music_name]}) %>" class="animation btn btn-default js-product-beat-action" data-type='off'>
				<span class="show"><i class="icon-volume-off lead show text-muted"></i></span>
				</a>
			<% } %>
		<% } %>
	</li> 
	
	<% }%>
 <% if(!_.isUndefined(authuser.user)){%>
  <li class="dropdown hidden-xs board-btn"> 
	  <a title="<%- i18next.t('Dashboard') %>" href="#" data-toggle="dropdown" class="btn btn-default js-show-boards-list"><span><%- i18next.t("Boards") %> </span><span><i class="icon-collapse"></i></span> </a>
	  <ul role="menu" class="dropdown-menu js-dropdown-popup col-xs-12 js-show-add-boards-list">
	  	 <li class="js-show-boards-list-response"></li>
		 <% if(!_.isEmpty(role_links.where({slug: "view_board_search"}))){ %>
			 <li class="clearfix js-qsearch-container js-boards-list-container">
				<div class="clearfix h6 col-xs-12">
					<input type="text" placeholder="<%- i18next.t('Find boards by name...') %>" class="js-search-boards form-control" id="inputBoardSearch" title="Find boards by name...">
				</div>
			 </li>
			 <li class="divider"></li>
		 <% } %>
		 <%

			if (!_.isEmpty(role_links.where({
				slug: "view_closed_boards"
			}))) {
		%>
			<li class="clearfix js-closed-board-list dropdown dropdown-submenu dropdown js-boards-list-container-search">            
				<a href="#" class="js-board-dropdown dropdown-toggle js-open-popover js-closed-boards" data-toggle="dropdown" title="<%- i18next.t('Closed Boards') %>"><%- i18next.t("Closed Boards") %></a>
				<ul class="sidebar-boards-list js-closedboard-list  list-unstyled list-group dropdown-menu pre-scrollable vertical-scrollbar"></ul>
				</li>
		<%
			}
			if (!_.isEmpty(role_links.where({
				slug: "view_stared_boards"
			}))) {
		%>
			<li class="clearfix js-board-dropdown js-stared-board-lists dropdown-submenu dropdown js-boards-list-container-search">            
					<a href="#" class="dropdown-toggle js-open-popover js-starred-boards" data-toggle="dropdown" title="<%- i18next.t('Starred Boards') %>"><%- i18next.t("Starred Boards") %></a>				
					<ul class="sidebar-boards-list js-board-starred-list list-unstyled list-group dropdown-menu pre-scrollable vertical-scrollbar"></ul>			
				</li>
		<%
			}

			if (!_.isEmpty(role_links.where({
				slug: "view_my_boards"
			}))) {
		%>
				<li class="clearfix js-my-board-lists dropdown-submenu dropdown js-boards-list-container-search">			
					<a href="#" class="js-board-dropdown dropdown-toggle js-open-popover js-my-boards-listing" data-toggle="dropdown" title="<%- i18next.t('My Boards') %>"><%- i18next.t("My Boards") %></a>
					<ul class="sidebar-boards-list js-myboard-list list-unstyled list-group dropdown-menu pre-scrollable vertical-scrollbar"></ul>			
				</li>
		<%
			} 		
		%>
			<li class="clearfix js-boards-list-container-search">            
			<a href="#/boards" title="<%- i18next.t('Boards') %>"><%- i18next.t("Boards") %></a>
			</li>
		<%

			if (!_.isEmpty(role_links.where({
				slug: "add_board"
			})) || !_.isEmpty(role_links.where({
				slug: "add_organization"
			}))) {
		%>		
			<li class="divider js-boards-list-container-search"></li>
			<li class="js-boards-list-container-search dropdown clearfix">
				<a title="<%- i18next.t('Add Board or Organization') %>" class="dropdown-toggle js-show-organizations-board-from btn btn-link" data-toggle="dropdown" href="#"><span class="pull-left"><i class="icon-plus"></i></span> <%- i18next.t("Add Board or Organization") %></a><ul role="menu" class="dropdown-menu dropdown-menu-right js-show-organizations-board-from-response js-dropdown-popup navbar-btn"></ul>
				</li>
		<%   
			 }
		%>
	  </ul>
	</li>
  <% if(typeof(model.user) !== "undefined" && !_.isEmpty(model.user) && (!_.isEmpty(role_links.where({slug: "view_organization_listing"})))){ %>
  <li class="hidden-xs org-btn"><a title="<%- i18next.t('Organizations') %>" href="#/organizations" class="btn btn-default"><span><%- i18next.t("Organizations") %></span></a></li>
   <% } %>	
  <% if(apps !== ""){ %>
  <li class="dropdown hidden-xs board-btn js-show-add-apps-list add-apps-list"> 
	  <a title="<%- i18next.t('Apps') %>" href="#" data-toggle="dropdown" class="btn btn-default js-show-apps-list"><span><%- i18next.t("Apps") %> </span><span><i class="icon-collapse"></i></span> </a>
	  <ul role="menu" class="dropdown-menu js-dropdown-popup col-xs-12 pre-scrollable vertical-scrollbar">
			<% _.each(apps, function(key,value) { %>
				<li id="<%- value %>" class="org-btn"><a title="<%- i18next.t(key.name) %>" href="#" data-toggle="modal" data-target="#<%- key.id %>_modal" class="highlight-icon clearfix"><span style="background-image:url(<%- key.icon %>); background-size:cover;" class="preview-thumbnail"></span><span class="details btn-block navbar-btn"><%- i18next.t(key.name) %></span></a></li>
			<% }); %>
			<li class="divider js-apps-list-container-search"></li>
			<li class="dropdown clearfix">
				<a title="<%- i18next.t('Add Apps') %>" class="dropdown-toggle  btn-link" target="_blank" href="http://restya.com/board/apps/?utm_source=Restyaboard - <%- SITE_NAME %>&utm_medium=web&utm_campaign=add_apps_footer"><span class="pull-left"><i class="icon-plus"></i></span> &nbsp; <%- i18next.t("Add Apps") %></a>
			</li>
	  </ul>
	</li>
  <% } %>
  <% } %>
</ul>
<div class="navbar-right clearfix">
	<ul class="nav nav-pills navbar-right">
	<% if(!_.isUndefined(authuser.user)){%>
	<% if((navigator.userAgent.toLowerCase().indexOf('android') > -1) && (navigator.userAgent.toLowerCase().indexOf('chrome') > -1)){ %>
		  <li class="hidden-xs"><a href="#" tittle="<%- i18next.t('Install this webapp to your phone') %>" data-toggle="modal" data-target="#add_home_modal" class="btn btn-default pull-right"><i class="icon-plus"></i></a></li>
	<% } %>
	<% if (!_.isUndefined(authuser.user) &&  !_.isEmpty(model.user) && model.user.role_id == 1) { %>
		<li class="phone-block"><a class="btn btn-primary pull-right js-show-qr-code hidden-xs" id="phone" title="<%- i18next.t('View in iOS App') %>" href=""><i class="icon-mobile-phone lead"></i></a></li>
	  	<li class="hidden-xs"><a title="<%- i18next.t('Admin CP') %>" class="btn btn-default pull-right admin-cp" href="#/activities"><span class="icon-user lead text-primary"></span><span class="hidden-xs text-primary"><%- i18next.t("Admin") %></span></a></li>
	  <% } %>
	  <li class="dropdown  instant_cards">
	   <a href="#" data-toggle="dropdown" class="dropdown-toggle btn btn-default pull-right" title="<%-model.user.full_name%> (<%-model.user.username%>)">
	   		<span class="js-user-img">
			<% if(!_.isEmpty(model.user.profile_picture_path)){ 
				var profile_picture_path = model.showImage('User', model.user.id, 'micro_thumb', true);
			%>
				<img class="img-rounded" width="16" height="16" src="<%= profile_picture_path%>" alt="[Images: <%- model.user.username%>]" title="<%- model.user.username%>" />
			<% }else{ %>
				<i class="avatar avatar-color-194 avatar-sm"><%- model.user.initials%></i>
			<% } %> 
			</span>&nbsp; <b class="caret"></b>
	   </a>
		<ul class="dropdown-menu text-left js-change-avatar-form-response">
			<li> <a title="<%- i18next.t('Logout') %>" href="#/users/logout"><%- i18next.t("Logout") %></a> </li>			
			<li class="divider"></li>
			<li><a href="#" class="js-show-shortcuts-modal" data-toggle="modal" data-target="#ModalShortcutView"><%- i18next.t('Shortcuts') %></a></li>
			<% if(model.is_show_enable_notification === true) { %>
				<li><a title="<%- i18next.t('Enable Desktop Notification') %>" href="#" class="js-enable-desktop-notification"><%- i18next.t("Enable Desktop Notification") %></a></li>
			<% } %>	
			<% if(!_.isEmpty(role_links.where({slug: "user_changepassword"})) && parseInt(authuser.user.is_ldap) === 0){ %>
				<li><a title="<%- i18next.t('Change Password') %>" href="#/users/<%-model.user.id%>/changepassword"><%- i18next.t("Change Password") %></a></li>
			<% } %>
		    <% if(!_.isEmpty(role_links.where({slug: "view_user"}))){ %>
				<li><a title="<%- i18next.t('Profile') %>" href="#/user/<%-model.user.id%>"><%- i18next.t("Profile") %></a></li>
			<% } %>
			<li><a title="<%- i18next.t('About Restyaboard') %>" href="#/about"><%- i18next.t("About Restyaboard") %></a></li>
			<li class="dropdown-submenu dropdown language-dropdown">
				<a href="#" data-toggle="dropdown" class="dropdown-toggle js-open-popover" title="<%- i18next.t('Change Language') %>"><span><i class="icon-caret-left"></i></span><%- i18next.t('Change Language') %></a>
				<ul class="dropdown-menu text-left js-change-language-form-response">
				   <% _.each(JSON.parse(languages), function(v, k) { %>
						<li> <a class="cur <% if(k !== authuser.user.language) { %>js-change-language<%}%>" data-lang="<%- k %>"><%- v %><% if((!_.isEmpty(authuser.user.language) && k === authuser.user.language) || (_.isEmpty(authuser.user.language) && k === DEFAULT_LANGUAGE)){ %><i class="icon-ok"></i><% } %></a> </li>			
				   <% }); %>
				   <li class="divider"></li>
				   <li> <a href="http://transifex.com/restya/restyaboard/?utm_source=Restyaboard&utm_medium=web&utm_campaign=translation_footer" target="_blank" title="<%- i18next.t('Contribute to Translation') %>"><span class="pull-left"><i class="icon-plus"></i></span>&nbsp;  <%- i18next.t('Contribute to Translation') %></a>
				   </li>
				</ul>
			</li>
		</ul>
	  </li>
	  <li class="dropdown notifications pull-right hidden-xs chat_icons"><a data-toggle="dropdown" href="#" class="btn btn-default pull-right js-show-notification" title="Notifications"><sup class="badge notification-count hide js-notification-count"></sup><i class="icon-bell lead"></i></a>
		<div id="all_activities" class="tabbable tabs-below dropdown-menu pull-right js-dropdown-popup" role="menu">
		  <div class="tab-content bg-info clearfix">
		    <div class="col-xs-12 user-filter navbar-btn">
				<span class="pull-left"><strong><%- i18next.t('Activity') %></strong></span>
				<ul class="nav nav-pills pull-right mob-no-mar">
					<li id="modal-activities"><a href="#" title="<%- i18next.t('Filter by activities') %>" class="text-muted"><i class="icon-time small"></i></a></li>
					<li id="modal-comments"><a href="#" title="<%- i18next.t('Filter by comments') %>" class="text-muted"><i class=" icon-comment-alt small"></i></a></li>
				</ul>    
			</div> 
			<div class="tab-pane js-all-activity-list notification-list vertical-scrollbar col-xs-12 border-top" id="all_">
				<ul id="js-all-activities" class="list-unstyled clearfix navbar-btn"></ul> 
			</div>
			<% if(!_.isEmpty(board_id)) { %>           
				<div class="tab-pane js-boards-activity-list active notification-list vertical-scrollbar col-xs-12 border-top" id="board_">
					<ul id="js-board-activities"  class="list-unstyled clearfix navbar-btn"></ul>
				</div>        
			<% } %> 
				<% if(!_.isEmpty(board_id) && board_id !== 0 && board_id !== '0') { %>
					<div class="col-xs-12 border-top text-center js-load-link" id="js-load-link1">
						<a href="#" title="View all activity" id="js-notification-load-more" class="js-board-load-more btn btn-link"><%- i18next.t("Load more activities") %></a>
					</div>
					<div class="col-xs-12 border-top text-center js-load-link hide" id="js-load-link2">
						<a href="#" title="<%- i18next.t('View all activity') %>" id="js-notification-load-more-all" class="js-board-load-more-all btn btn-link"><%- i18next.t("Load more activities") %></a>
					</div>
				<%} else { %>  
				<div class="col-xs-12 border-top text-center js-load-link" id="js-load-link">
					<a href="#" title="<%- i18next.t('View all activity') %>" id="js-notification-load-more-all" class="js-all-load-more-all btn btn-link"><%- i18next.t("Load more activities") %></a>
				</div>  
				<% } %>
			 </div>
			<ul class="nav nav-tabs <% if(_.isEmpty(board_id)){ %>hide<% } %>"> 
				<li><a href="#all_" data-toggle="tab" class="js-all-activities"><%- i18next.t('All') %></a></li>
				
				<% if(!_.isEmpty(board_id) && board_id !== 0 && board_id !== '0' && (!_.isUndefined(authuser.user) && (authuser.user.role_id == 1 || !_.isEmpty(board.acl_links.where({slug: "view_board_activities", board_user_role_id: parseInt(board.board_user_role_id)}))))) { %>
					<li class="active"><a href="#board_" data-toggle="tab" class="js-board-activities"><%- i18next.t("In this board") %></a></li>
				<% } %>
			</ul>
		</div>
	  </li>
	  <% } else { %>
		<% if(board_id !== undefined && board_id !== null && board_id !== ""){ %>
	  		<li class="<% if(Backbone.history.fragment.indexOf('users/register') != -1){%>active<%}%>"><a href="#/users/register" title="<%- i18next.t('Register') %>"><strong><%- i18next.t("Register") %></strong></a></li>
			<li class="<% if(Backbone.history.fragment.indexOf('users/login') != -1){%>active<%}%>"><a href="#/users/login"	title="<%- i18next.t('Login') %>"><strong><%- i18next.t("Login") %></strong></a></li>
		<% } %>
	  <% } %>
	 </ul>
</div>
<div class="hidden-blocks hide js-hidden-blocks"></div>	
</div>
</section>
<section class="search-block-main" id="search-page-result-block"></section>
